]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
remote-search: implement LaunchSearch() DBus method
authorTanner Doshier <doshitan@gmail.com>
Mon, 26 Nov 2012 21:55:25 +0000 (16:55 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 6 Dec 2012 17:15:13 +0000 (12:15 -0500)
This will be used to launch a search in the application itself.

https://bugzilla.gnome.org/show_bug.cgi?id=689735

js/ui/remoteSearch.js
js/ui/search.js

index 1a3132f8e8648be9ed5cd22c9a31ff516c6cb440..5e9ee89eaffbb754d36901690a0a4e56f237da09 100644 (file)
@@ -265,6 +265,13 @@ const RemoteSearchProvider = new Lang.Class({
 
     activateResult: function(id) {
         this.proxy.ActivateResultRemote(id);
+    },
+
+    launchSearch: function(terms) {
+        // the provider is not compatible with the new version of the interface, launch
+        // the app itself but warn so we can catch the error in logs
+        log('Search provider ' + this.appInfo.get_id() + ' does not implement LaunchSearch');
+        this.appInfo.launch([], global.create_app_launch_context());
     }
 });
 
@@ -274,9 +281,15 @@ const RemoteSearchProvider2 = new Lang.Class({
 
     _init: function(appInfo, dbusName, dbusPath) {
         this.parent(appInfo, dbusName, dbusPath, SearchProvider2Proxy);
+
+        this.canLaunchSearch = true;
     },
 
     activateResult: function(id) {
         this.proxy.ActivateResultRemote(id, [], 0);
+    },
+
+    launchSearch: function(terms) {
+        this.proxy.LaunchSearchRemote(terms);
     }
 });
index 2e746d8ca61f228e00fce73a3d2e92480a69297f..e21c2a74120eca929f51c1790058122d42e107f0 100644 (file)
@@ -81,6 +81,7 @@ const SearchProvider = new Lang.Class({
         this.appInfo = appInfo;
         this.searchSystem = null;
         this.isRemoteProvider = !!isRemoteProvider;
+        this.canLaunchSearch = false;
     },
 
     /**
@@ -167,6 +168,16 @@ const SearchProvider = new Lang.Class({
      */
     activateResult: function(id) {
         throw new Error('Not implemented');
+    },
+
+    /**
+     * launchSearch:
+     * @terms: Current search terms
+     *
+     * Called when the user clicks the provider icon.
+     */
+    launchSearch: function(terms) {
+        throw new Error('Not implemented');
     }
 });
 Signals.addSignalMethods(SearchProvider.prototype);